<div id="openingOrder">
    <input type="hidden" id="reservationsIdx" value="">
    <input type="hidden" id="moneyBalanceyw" value="${moneyBalance}">
    <input type="hidden" id="jfbalanceyw" value="${jfbalance}">
    <div id="openingProject">
        <h3 style="display: flex">
            <span>收费项目列表</span>
            <span style="flex: 1;text-align: right;">
                <a href="javascript:;" id="normal_project" style="color: #FF7E00;font-weight: bold;">正常</a>
                <a href="javascript:;" id="free_admission" style="font-weight: bold;">免费</a>
            </span>
        </h3>
        <div id="openingBox">
            <div style="padding:10px 15px;">
                <select onchange="openFirstLevelProject()" name="firstLevelProjectDiv" id="firstLevelProjectDivsd"></select>
            </div>
            <div id="payServiceNamesd"></div>
        </div>
        <div id="openingBoxTwo" style="height: calc(100% - 40px);display: none;">
            <div style="height: 100%;padding: 0 15px;overflow: auto;" id="payServiceNameTwo"></div>
        </div>
    </div>
    <div id="projectList">
        <h3>
            <button class="btn" type="button"><span class="glyphicon glyphicon-chevron-left" style="top: -3px;"></span></button>
            <input type="text" autocomplete="off" id="payServiceNames" placeholder="首字母/价格搜索" class="inputOne" oninput="payServiceSearch()">
            <select name="treatmentUnitTwo" id="treatmentUnitTwo" style="height: 26px;vertical-align: bottom;outline: none; ">
                <option value="">--请选科室--</option>
                @for(str in departmentList){
                <option value="${str.department}">${str.department}</option>
                @}
            </select>
            <ul id="dataUl" style="display: none;"></ul>
        </h3>
        <div id="projectListBox">
            <div class="original">
                <div class="projectListTitle">
                    <div style="flex: 1">牙位</div>
                    <div style="flex: 2">项目名称</div>
                    <div>单价(元)</div>
                    <div>单位</div>
                    <div>数量</div>
                    <div>折后金额</div>
                    <div>折扣(100%)</div>
                    <div style="display: none">实收金额</div>
                    <div>医生</div>
                    <div>操作</div>
                </div>
                <div id="projectListInfo" class="singleBox">
                    @for(dealInfo in dealInfoList){
                    <div class="proDealInfo">
                        <div id="${dealInfo.payServiceId}toothBox" class="toothBox" style="display: flex;flex-direction: column;flex: 1;height: 24px;">
                            <input class="id" type="hidden" value="${dealInfo.id}" />
                            <div style="flex: 1;display: flex;border-bottom: 1px solid #999999">
                                <div id="${dealInfo.payServiceId}toothBox1" class="leftUp" style="flex: 1;border-right: 1px solid #999999;line-height: 11px;text-align: right;padding-right: 5px;">${dealInfo.leftUp}</div>
                                <div id="${dealInfo.payServiceId}toothBox2" class="rightUp" style="flex: 1;line-height: 11px;padding-left: 5px;">${dealInfo.rightUp}</div>
                            </div>
                            <div style="flex: 1;display: flex">
                                <div id="${dealInfo.payServiceId}toothBox3" class="leftDown" style="flex: 1;border-right: 1px solid #999999;line-height: 11px;text-align: right;padding-right: 5px;">${dealInfo.leftDown}</div>
                                <div id="${dealInfo.payServiceId}toothBox4" class="rightDown" style="flex: 1;line-height: 11px;padding-left: 5px;">${dealInfo.rightDown}</div>
                            </div>
                        </div>
                        <div style="flex: 2;">
                                <span class="payServiceName">${dealInfo.payServiceName}
                                    <span><input class="payServiceId" value="${dealInfo.payServiceId}" type="hidden"><input class="vipPayserviceId" value="${dealInfo.vipPayserviceId}" type="hidden"></span>
                                </span>
                        </div>
                        <div>
                            @if(dealInfo.firstLevelProject == '种植牙俱乐部' ){
                            <input style="text-align: center" autocomplete="off" disabled oninput="decimalNum(this),updatePrice(this)"  type="text" class="payService" name="payService" value="${dealInfo.payService}">
                            @}
                            @if(dealInfo.firstLevelProject != '种植牙俱乐部' ){
                            <input style="text-align: center" autocomplete="off" oninput="decimalNum(this),updatePrice(this)"  type="text" class="payService" name="payService" value="${dealInfo.payService}">
                            @}
                           <input class="discountHide" value="${dealInfo.payService}" type="hidden">
                            <input class="unitPrice" value="${dealInfo.payServicePriceTwo}" type="hidden">
                            <input class="unitPriceOne" value="${dealInfo.payServicePriceOne}" type="hidden"/>
                            <input class="unitPriceTwo" value="${dealInfo.payServicePriceTwo}" type="hidden"/>
                            <input class="priceRecord" value="${dealInfo.payService}" type="hidden"/>
                            <input class="priceDiscountRecord" value="${dealInfo.orderDiscount}" type="hidden"/>
                            <input class="primary" value="${dealInfo.foldingPay}" type="hidden" >
                            <input class="realAmount" value="${dealInfo.foldingPay}" type="hidden" >
                        </div>
                        <div><span>${dealInfo.unit}</span></div>
                        <div>
                            <a onclick="numReduce(this)" style="border:1px solid  #999999;width: 17px;height: 22px;display: inline-block;" class="reduce">-</a><input class="num" style="width:35px;text-align: center;vertical-align: top;" oninput="decimalNum(this),changeNum(this)"
                            type="text" value="${dealInfo.payServiceNum}"><a onclick="numAdd(this)" style="border:1px solid  #999999;width: 17px;height: 22px;display: inline-block;" class="add">+</a>
                        </div>
                        @if(dealInfo.firstLevelProject == '种植牙俱乐部' ){
                        <div>
                            <input autocomplete="off" disabled oninput="decimalNum(this),priceDiscount(this)" class="amount" style="text-align: center" value="${dealInfo.foldingPay}" type="text">
                        </div>
                        <div>
                            <input disabled oninput="decimalNum(this),updateDiscount(this)" class="discount" value="${dealInfo.orderDiscount}" type="text" />
                        </div>
                        @}
                        @if(dealInfo.firstLevelProject != '种植牙俱乐部' ){
                        <div>
                            <input autocomplete="off" oninput="decimalNum(this),priceDiscount(this)" class="amount" style="text-align: center" value="${dealInfo.foldingPay}" type="text">
                        </div>
                        <div>
                            <input oninput="decimalNum(this),updateDiscount(this)" class="discount" value="${dealInfo.orderDiscount}" type="text" />
                        </div>
                        @}
                        <div>
                            <select class="doctor" style="width: 90%;">
                                @for(doctor in docList){
                                    @if(dealInfo.doctor == doctor.doctor){
                                    <option selected ="selected" value="${doctor.doctor}">${doctor.doctor}</option>
                                    @}
                                    @if(dealInfo.doctor != doctor.doctor){
                                    <option value="${doctor.doctor}">${doctor.doctor}</option>
                                    @}
                                @}
                            </select>
                        </div>
                        <div><a onclick="deleteProject(this,'${dealInfo.vipPayserviceId}')">删除</a></div>
                    </div>
                    @}
                </div>
                <div class="discountBox">
                    <div>
                        <div>
                            <span>整体折扣(%)</span>
                            <input  id="totalDiscount" readonly="readonly"  value="${totalDiscount}" type="text"/>
                        </div>
                    </div>
                    <div style="text-align: right">
                        <div>
                            <span>原价</span>
                            <input id="originalPrice" type="text" value="${originalPrice}" readonly="readonly"/>
                        </div>
                        <div>
                            <span style="color: #FF7E00">折后金额</span>
                            <input  id="totalSum1" type="text" value="${totalSum1}" readonly="readonly"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="integralBox">
                <label for="earnest" ><input type="checkbox" name="discount" id="earnest" value="储值划扣"><span>储值余额<span id="moneyBalance" style="margin-left: 10px;">
                    ${moneyBalance}</span></span></label>
                <label for="integral"><input type="checkbox" name="discount" id="integral" value="使用返现"><span>使用返现/优惠券可抵扣金额<span id="jfbalance" style="margin-left: 10px;">
                    ${jfbalance}</span></span></label>
                <label for="membershipOther"><input type="checkbox" name="membership" id="membershipOther" value="使用其他会员折扣"><span>使用其他会员折扣</span></label>
          </div>
            <div id="isDepositAndIsDeposit" class="original projectBox" style="display: none">
                <div>
                    <div class="projectListTitle">
                        <div style="flex: 2">项目名称</div>
                        <div style="flex: 0.5">单价</div>
                        <div style="flex: 0.5">数量</div>
                        <div style="flex: 0.5">折后价</div>
                        <div style="flex: 0.5">实收</div>
                        <div class="earnest isDeposit">划扣储值</div>
                        <div class="integral isDeduction">抵用方式</div>
                        <div class="integral isDeduction">抵用金额</div>
                    </div>
                    <div id="discountBox" class="singleBox"></div>
                </div>
                <div class="discountBox discountBoxHide">
                    <div style="text-align: right">
                        <div>
                            <span style="color: #FF7E00">本次应收</span>
                            <input readonly="readonly" id="realTotalSum2" type="text" value=""/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="chargeBox">
                <div>
                    <span>应收：</span>
                    <input type="text"  readonly="readonly" id="newTotalSum" value="${totalSum1}">
                </div>
                <div>
                    <span>缴费：</span>
                    <input type="text" oninput="decimalNum(this),oninputPayAmount()" id="newPayAmount" style="background: white;color: #ff7e00;" value="${totalSum1}">
                </div>
                <div>
                    <span>欠费：</span>
                    <input type="text" readonly="readonly" style="color: red;" value="0" id="newArrears">
                </div>
            </div>
            <div class="personnelBox">
                <div style="margin-bottom: 10px;">
                    <span>医生*：</span>
                    <select onchange="chooseDoctor()" id="projectDoctor">
                        <option value="">--请选择医生--</option>
                        @for(str in doctorList){
                        <option value="${str.doctor}">${str.doctor}</option>
                        @}
                    </select>
                </div>
                <div style="margin-bottom: 10px;">
                    <span>护士*：</span>
                    <select id="projectNurse">
                        <option value="">--请选择护士--</option>
                        @for(str in nursesList){
                        <option value="${str.nurse}">${str.nurse}</option>
                        @}
                    </select>
                </div>
                <div>
                    <span style="vertical-align: top;">备&nbsp;&nbsp;&nbsp;注 ：</span>
                    <textarea name="proRemark" id="proRemark"></textarea>
                </div>
            </div>
            <div class="submissionBox">
                <div class="btnBox">
                    <button onclick="updateDealInfo()" type="button" class="btn">确认</button>
                    <button id="cancel" onclick="parent.layer.close(parent.layer.getFrameIndex(window.name))"  type="button" class="btn">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>
@include("/common/tooth_positions.html"){
@}
<script src="${ctxPath}/static/modular/tcCenter/consultant/open_bills.js?v=20200628"></script>
<script>var checkoutMethodHtml = '';$(function () {checkoutMethodHtml = "${checkoutMethodHtml}";});</script>